package com.example.springbootdemo.service;

import com.example.springbootdemo.dao.DeptDao;
import com.example.springbootdemo.po.Dept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
/*
* 部门业务逻辑实现
*
* */

@Service
@Transactional
public class DeptServiceImpl implements DeptService {

    @Autowired
    private DeptDao deptDao;


    @Override
    @Transactional(readOnly = true)
    public List<Dept> queryDept(Dept dept) {
        return this.deptDao.queryDept(dept);
    }

    @Override
    public void addDept(Dept dept) {
        this.deptDao.addDept(dept);
    }

    @Override
    public void updateDept(Dept dept) {
        this.deptDao.updateDept(dept);
    }

    @Override
    public void delDept(Integer deptNo) {
        this.deptDao.delDept(deptNo);

    }
}
